package com.decent.ejfadmin.common.bean;


import java.io.Serializable;

/**
 * describe:试充卡密redis信息
 *
 * @author 陈豆豆
 * @date 2019/09/07
 */
public class TrySellRedisBean implements Serializable {
    private static final long serialVersionUID = 655177760786273439L;
    /**
     * 提交次数
     */
    private int commitTime = 0;
    /**
     * 是否在提交中
     */
    private boolean committed = false;

    public int getCommitTime() {
        return commitTime;
    }

    public void setCommitTime(int commitTime) {
        this.commitTime = commitTime;
    }

    public boolean isCommitted() {
        return committed;
    }

    public void setCommitted(boolean committed) {
        this.committed = committed;
    }

    @Override
    public String toString() {
        return "TrySellRedisBean{" +
                "commitTime=" + commitTime +
                ", committed=" + committed +
                '}';
    }

    /**
     * 转换批次提交状态
     */
    public void switchCommitStatus() {
        this.committed = !committed;
    }

    /**
     * 记录提交次数
     */
    public void addCommitTime() {
        this.commitTime = committed ? commitTime : (commitTime + 1);
    }
}
